package com.easthome.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author cxiaoy
 * @Date 2022/10/14 14:22
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RespResult<T> {

    private String msg;
    private String code;
    private T data;

    public static RespResult success(){
        return new RespResult("ok","200",null);
    }

    public static<U> RespResult<U> success(U data){
        return new RespResult("ok","200",data);
    }

    public static<U> RespResult<U> err(){
        return new RespResult("err","9527",null);
    }

}
